package com.baitengsoft.patentservicemonitor.api.service.impl;

import com.baitengsoft.patentservicemonitor.api.dao.RptPatentIpcDao;
import com.baitengsoft.patentservicemonitor.api.entity.RptPatentIpcEntity;
import com.baitengsoft.patentservicemonitor.api.model.RptPatentIpcModel;
import com.baitengsoft.patentservicemonitor.api.model.param.RptPatentIpcParam;
import com.baitengsoft.patentservicemonitor.api.service.RptPatentIpcService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Created by 周俊 on 2018/1/2.
 */
@Service("RptPatentIpcService")
public class RptPatentIpcImpl implements RptPatentIpcService {
    @Autowired
    private RptPatentIpcDao rptPatentIpcDao;

    @Override
    public void addorUpdateRptPatentIpcInfo(RptPatentIpcEntity rptPatentIpcEntity) {
        if(rptPatentIpcEntity.getID() > 0){
            rptPatentIpcDao.update(rptPatentIpcEntity);
        }else {
            rptPatentIpcDao.save(rptPatentIpcEntity);
        }
    }

    @Override
    public int queryRptPatentIpc(Integer PlatformID, Integer ParentID) {
        int count = rptPatentIpcDao.queryRptPatentIpc(PlatformID,ParentID);
        return count;
    }

    @Override
    public RptPatentIpcEntity queryRptPatentIpcByQuery(Integer PlatformID, Integer ParentID) {
        RptPatentIpcEntity entity = rptPatentIpcDao.queryRptPatentIpcByQuery(PlatformID,ParentID);
        return entity;
    }
}
